package com.lnking.lnkingplace.controller;


import com.lnking.common.http.ReturnResult;
import com.lnking.lnkingplace.Util.IdCardUtil;
import com.lnking.lnkingplace.model.request.Position.PositionAddRequest;
import com.lnking.lnkingplace.model.request.Position.PositionSearchRequest;
import com.lnking.lnkingplace.model.request.user.UserAddRequest;
import com.lnking.lnkingplace.service.IPointPositionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author zhangqt
 * @since 2022-11-26
 */
@RestController
@RequestMapping("/point-position")
@Api(tags = "核酸点位")
public class PointPositionController {


    @Autowired
    IPointPositionService pointPositionService;

    @ApiOperation("添加")
    @PostMapping("add")
    public ReturnResult index(@RequestBody @Valid PositionAddRequest params) throws Exception {
        pointPositionService.add(params);
        return ReturnResult.success();
    }

    @ApiOperation("列表")
    @GetMapping("page/list")
    public ReturnResult list( PositionSearchRequest params) throws Exception {
        return ReturnResult.success(pointPositionService.pageList(params));
    }
}
